argss <- commandArgs(trailingOnly = TRUE)

fil <- argss[1]
print(fil)


perct=read.table(fil)
perct=perct$V1

ylim=c(0, 100)
xlim=c(0,26)
chr_num=seq(1,25,2)

chrs=c(seq(1,22), 'X', 'Y', 'MT')

pdf("1.cov.pdf", width=9, height=6)

par(ann=F, xaxs='i', yaxs='i')

plot(perct[-1], type='h', xlim=xlim, ylim=ylim, cex.axis=.5, col='blue', xaxt='n')
abline(h=perct[1], col='red', lty=2)

axis(1, at=chr_num, labels=chrs[chr_num], tick=F, cex.axis=.5, line=-1)

title(main='Coverage profile', xlab='Chr', ylab='Percent cov >= 1')

dev.off()

q(save = "yes", status = 0, runLast = FALSE)